package org.example;

public class Navy extends Army{
    private String shipName;

    public Navy(String name, int strength, String shipName) {
        super(name, strength);
        this.shipName = shipName;
    }

    public String getShipName() {
        return shipName;
    }@Override
    protected void mission(){
        super.mission();
        System.out.println("特定海军任务");
    }
    public void displayInfo(boolean detailed){
        if(detailed){
            System.out.println("船舰："+shipName);
        }else{
            super.displayInfo();
        }

    }
}
